﻿app.factory('userRoomFactory', function ($http) {
    var factory = {};

    factory.GetRoomByUser = function (id) {
        return $http.get(getRoomByUserApiAddress + id);
    };
    factory.getUserByRoom = function (id) {
        return $http.get(getUserByRoomApiAddress + id);
    };
    factory.postUserRoom = function(dataPost) {
        return $http.post(postRoomUserApiAddress, dataPost);
    };
    factory.delUserRoomNoId = function (dataPost) {
        return $http.post(delRoomUserApiAddress, dataPost);
    };
    factory.delUserRoom = function(id) {
        return $http.post(delRoomUserApiAddress+ id);
    };
    factory.delAllUserInRoom = function (id) {
        return $http.post(delAllUserInRoomApiAddress + id);
    };
    factory.checkUserType = function(dataPost) {
        return $http.post(postUserRoomInfoApiAddress, dataPost);
    };
    return factory;
});